package eu.whowie.bluecontrol.server.web;

import com.vaadin.*;
import com.vaadin.terminal.gwt.server.WebBrowser;
import com.vaadin.ui.*;

public class Ui extends Application {

	private Object context;
	private HorizontalLayout toolBarComponent;

	@Override
	public void init() {
		System.out.println("hello world");
		// Main window is the primary browser window
        final Window main = new Window("Hello window");

        
        setMainWindow(main);

        // "Hello world" text is added to window as a Label component
        main.addComponent(new Label("Hello World!"));
        main.addComponent(createToolbar());
        WebBrowser browser = (WebBrowser) main.getWindow().getTerminal();
        System.out.println("hello world: "+browser);
		
	}
	private HorizontalLayout createToolbar() {
		if (toolBarComponent == null) {
			toolBarComponent = new HorizontalLayout();
			Button info = new Button("Info");
			
			toolBarComponent.addComponent(info);
		}
		return toolBarComponent;

	}

}
